﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AlbonWeb.Order.ashx
{
    /// <summary>
    /// Summary description for Handler2
    /// </summary>
    public class Handler2 : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write(checkInput(context));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        private string checkInput(HttpContext context)
        {
            string ret = "";
            if (context.Request["refNo"] != null)
            {
               string refNo=context.Request["refNo"].ToString();
               BLL.OrderBLL orderbll=new BLL.OrderBLL();
               ret =orderbll.checkRefNo(refNo,context.User.Identity.Name);
            }
            else if (context.Request["clientName"] != null)
            {
                string name = context.Request["clientName"].ToString();
                BLL.ClientBLL clientbll = new BLL.ClientBLL();
                ret = clientbll.checkName(name, context.User.Identity.Name);
            }
            return ret;
        }
    }
}